﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using XYW.WebSite;

namespace xyw.admincp
{
    public partial class DefaultChangePwd : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            XYW.BLL.Users blluser = new XYW.BLL.Users();
            XYW.Model.Users modelUser = blluser.GetModel(CurUser.Id);
            if (modelUser.passWord == XYW.Common.DEncrypt.DESEncrypt.Encrypt(txt_Yuan.Text))
            {
                modelUser.passWord = XYW.Common.DEncrypt.DESEncrypt.Encrypt(txt_Psw.Text);
                blluser.Update(modelUser);
                ClientScript.RegisterClientScriptBlock(this.GetType(), "ok", "<script>alert('密码修改成功！')</script>");
            }
            else
                ClientScript.RegisterClientScriptBlock(this.GetType(), "err", "<script>alert('原密码不正确！')</script>");
        }
    }
}